import {
    apiServiceStatisticalController,
    collectServiceStatisticsTotal,
    dataForEcharts
} from "./apiStatisticalMonitoring"
// 共享服务请求方统计
export const shareRequestStatisticsDetailController = (ev,pageNum) => {
    apiServiceStatisticalController('getShareRequestStatisticsDetail', {"pageNum": pageNum})
        .then(
            (res) => {
                ev.tableData = res.data.data;
                // 后台物理分页返回的list无法动态实现
                // ev.pageTotal = res.data.data.length;
                // console.log(res.data.data.length);
            }
        )
}
// 共享服务服务方统计
export const shareServiceStatisticsDetailController = (ev,pageNum) => {
    apiServiceStatisticalController('getShareServiceStatisticsDetail', {"pageNum": pageNum})
        .then(
            (res) => {
                ev.tableData = res.data.data.list;
                ev.pageTotal = res.data.data.total;
                // 后台物理分页返回的list无法动态实现
                // console.log(res.data.data.length);
                 console.log(res);
            }
        )
}
// 采集服务统计
export const collectServiceStatisticsDetail = (ev,pageNum) => {
    apiServiceStatisticalController('getCollectServiceStatisticsDetail', {"pageNum": pageNum})
        .then(
            (res) => {
               // ev.tableData = res.data.data;
               ev.tableData = res.data.data.list;
               ev.pageTotal = res.data.data.total;
                console.log(res.data.data.list);
                // console.log(res.data.data)
            }
        )
}
// 采集服务统计获取总量统计的数据
export const collectServiceStatisticsTotalController = (ev) => {
    collectServiceStatisticsTotal('collectServiceStatistics')
        .then(
            (res) => {
                ev.totalTable = res.data.data;
                console.log(res.data.data);
                // console.log(JSON.stringify(res.data.data));
            }
        )
}

// 采集服务统计获取图表所需要的数据
export const dataForEchartsController = (ev) => {
    dataForEcharts('getTopCollectStatistics')
        .then(
            (res) => {
                console.log(JSON.stringify(res.data));
                console.log(res);
                ev.columnName=res.data.data.type;
                ev.columnData=res.data.data.value;
            }
        )
}

// 共享服务统计获取总量统计的数据
export const shareServiceStatisticsTotalController = (ev) => {
    collectServiceStatisticsTotal('shareServiceStatistics')
        .then(
            (res) => {
                ev.totalTable = res.data.data;
                console.log(res);
                // console.log(JSON.stringify(res.data.data));
            }
        )
}


// 采集服务统计获取图表所需要的数据
export const shareDataForEchartsController = (ev) => {
    dataForEcharts('getTopShareStatistics')
        .then(
            (res) => {
               // console.log(JSON.stringify(res.data));
                console.log(res);
                ev.columnName=res.data.data.type;
                ev.columnData=res.data.data.value;
            }
        )
}